home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_3.adf / Compiler_headers / Include / locale.h < prev    next >
C/C++ Source or Header  |  1992-07-30  |  4KB  |  144 lines

  1. /* Copyright (c) 1992 SAS Institute, Inc., Cary, NC USA */
  2. /* All Rights Reserved */
  3.  
  4.  
  5. #ifndef _LOCALE_H
  6. #define _LOCALE_H 1
  7.  
  8. #ifndef NULL
  9. #define NULL   ((void *) 0)
  10. #endif
  11.  
  12. #ifndef _SIZE_T
  13. #define _SIZE_T
  14. typedef unsigned int size_t;
  15. #endif
  16.  
  17. #ifndef _WCHAR_T
  18. #define _WCHAR_T
  19. typedef char wchar_t;
  20. #endif
  21.  
  22.  
  23. #define LC_COLLATE  0
  24. #define LC_CTYPE    1
  25. #define LC_NUMERIC  2
  26. #define LC_TIME     3
  27. #define LC_MONETARY 4
  28. #define LC_ALL      5
  29.  
  30.  
  31. struct lconv {
  32.     char *decimal_point;
  33.     char *thousands_sep;
  34.     char *grouping;
  35. #define LCONVM int_curr_symbol
  36.     char *int_curr_symbol;
  37.     char *currency_symbol;
  38.     char *mon_decimal_point;
  39.     char *mon_thousands_sep;
  40.     char *mon_grouping;
  41.     char *positive_sign;
  42.     char *negative_sign;
  43.     char int_frac_digits;
  44.     char frac_digits;
  45.     char p_cs_precedes;
  46.     char p_sep_by_space;
  47.     char n_cs_precedes;
  48.     char n_sep_by_space;
  49.     char p_sign_posn;
  50.     char n_sign_posn;
  51. };
  52.  
  53.  
  54. struct __lconvn {            /* lconv from LC_NUMERIC */
  55.     char *decimal_point;
  56.     char *thousands_sep;
  57.     char *grouping;
  58. };
  59.  
  60. struct __lconvm {            /* lconv from LC_MONETARY */
  61.     char *int_curr_symbol;
  62.     char *currency_symbol;
  63.     char *mon_decimal_point;
  64.     char *mon_thousands_sep;
  65.     char *mon_grouping;
  66.     char *positive_sign;
  67.     char *negative_sign;
  68.     char int_frac_digits;
  69.     char frac_digits;
  70.     char p_cs_precedes;
  71.     char p_sep_by_space;
  72.     char n_cs_precedes;
  73.     char n_sep_by_space;
  74.     char p_sign_posn;
  75.     char n_sign_posn;
  76. };
  77.  
  78.  
  79. struct __locale {
  80.     struct __locale *nxtlc;    /* next locale pointer            */
  81.     char *lcname;        /* locale name             LC_ALL     */
  82.     char **abswday;        /* abbreviated weekday names     LC_TIME    */
  83.     char **swday;        /* full weekday names        LC_TIME    */
  84.     char **absmon;        /* abbrev. month names        LC_TIME */
  85.     char **smon;        /* full month names        LC_TIME    */
  86.     char **sampm;        /* names for am. and pm.    LC_TIME */
  87.     char *stzone;        /* name for timezone        LC_TIME */
  88.     int *lccomp;        /* collating sequence         LC_COLLATE? */
  89.     int *ixfrm;                /* translate table        LC_COLLATE */
  90.     char decpt;                /* decimal point char        LC_NUMERIC */
  91.     char mb_cur_max;            /* maximum number of bytes in
  92.                        wide character        LC_CTYPE */
  93.     char mb_state;        /* flag for state-dep mappings  LC_CTYPE */
  94.                         /* mblen function        LC_CTYPE */
  95.     int  (*mblen)(const char *, size_t);
  96.     int  mblen_state;            /* mblen shift state         LC_CTYPE */
  97.                         /* mbtowc function        LC_CTYPE */
  98.     int  (*mbtowc)(wchar_t *,const char *, size_t);
  99.     int  mbtowc_state;            /* mbtowc shift state         LC_CTYPE */
  100.                         /* wctomb function        LC_CTYPE */
  101.     int  (*wctomb)(char *, wchar_t);
  102.     int  wctomb_state;            /* wctomb shift state         LC_CTYPE */
  103.                         /* mbstowcs function        LC_CTYPE */
  104.     size_t  (*mbstowcs)(wchar_t *,const char *, size_t);
  105.     int  mbstowcs_state;    /* mbstowcs shift state     LC_CTYPE */
  106.                         /* wcstombs function        LC_CTYPE */
  107.     size_t  (*wcstombs)(char *, const wchar_t *,size_t);
  108.     int  wcstombs_state;    /* wcstombs shift state        LC_CTYPE */
  109.     struct __lconvn    *lconvn; /* structure for lconv        LC_NUMERIC */
  110.     struct __lconvm    *lconvm; /* structure for lconv        LC_MONETARY */
  111. };
  112.  
  113.  
  114. extern struct __locale *__clocale[];    /* current locale for each category */
  115. extern struct lconv  __clconv;            /* current lconv array */
  116. extern char __decpt;            /* current decimal point character */
  117. #define DECPT __decpt
  118. extern char __mb_cur_max;
  119. extern struct __locale *__flocale;      /* first locale in linked list ("C") */
  120. extern struct __locale *__llocale;      /* last locale in linked list */
  121.  
  122. extern char *setlocale(int, const char *);
  123. extern struct lconv *localeconv(void);
  124. extern struct __locale *readlocale(const char *);
  125.  
  126.  
  127. /***
  128. *     Error messages when reading a locale, stored in lclerror
  129. ***/
  130.  
  131. #define _LCLNAME        1    /* pathname for locale file too long */
  132. #define _LCLOPEN        2    /* Unable to open locale file */
  133. #define _LCLCOLL        3    /* multiple collate spec */
  134. #define _LCLCTYPE       4    /* multiple c types spec */
  135. #define _LCLNUMERIC    5    /* multiple numeric spec */
  136. #define _LCLTIME        6    /* multiple time spec */
  137. #define _LCLMONETARY    7    /* multiple monetary spec */
  138. #define _LCLREAD        8    /* Error reading locale file */
  139. #define _LCLEND        9    /* Missing END record */
  140.  
  141. extern int    __lclerror;
  142.  
  143. #endif
  144.